#include<iostream>
using namespace std;
const int N = 510;
int arr[N];
int brr[N];
int crr[N];
int ab[N * N];
int L, M, K;
int cmp(const void* e1, const void* e2)
{
	return *(int*)e1 - *(int*)e2;
}
bool judge(int n,int k)
{
	int left = 0;
	int right = k ;
	while (left < right) {
		int mid = (left + right) >> 1;
		if (ab[mid] > n) {
			right = mid ;
		}
		else if (ab[mid] < n) {
			left = mid + 1;
		}
		else {
			return true;
		}
	}
	return false;
}
int main()
{
	int case_1 = 1;
	while (cin >> L >> M >> K) {
		cout << "Case " << case_1++ << ":" << endl;
		for (int i = 0; i < L; i++) {
			cin >> arr[i];
		}
		for (int i = 0; i < M; i++) {
			cin >> brr[i];
		}
		for (int i = 0; i < K; i++) {
			cin >> crr[i];
		}
		int k = 0;
		for (int i = 0; i < L; i++) {
			for (int j = 0; j < M; j++) {
				ab[k++] = arr[i] + brr[j];
			}
		}
		qsort(ab, k, sizeof(ab[0]), cmp);
		int t = 0;
		cin >> t;
		while (t--) {
			int x;
			cin >> x;
			bool flag = false;
			for (int i = 0; i < K; i++) {
				int c = x - crr[i];
				if (judge(c,k)) {
					flag = true;
					break;
				}
			}
			if (flag) {
				cout << "YES" << endl;
			}
			else {
				cout << "NO" << endl;
			}
		}
	}
	return 0;
}